home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC-SIG: World of Education
/
PC-SiG's World of Education.iso
/
run
/
2602
/
constnt.hlp
< prev
next >
Wrap
Text File
|
1989-02-03
|
3KB
|
60 lines
Constants are either explicit decimal values, dates, times, names that
have been assigned a constant value, or one of the predefined keywords
given below. Constants do not cause implicit loops or create 'variables'
when used in Assignment statments.
All constants are treated as double precision floating point values (64
bits) even when a decimal point is not included in the value.
+
Date and time values (when embedded in source code) must be preceded by
a '#' character so DAN does not mistake the '/' for a divide symbol or
the ':' for an illegal character. Some examples are:
Mass = 120000; {explicit decimal constant}
day = #9/29/86; {a date}
Now = #13:21:59.12; {a time}
'Mass', 'day', and 'Now' are all constants even though they are defined
with Assignment statements. They are treated as if they were constants
in any subsequent usage. Hence, 'Halfmass = Mass/2;' defines another
constant, while 'force = Mass * OPER;' defines a variable (force) since
OPER is a variable.
+
Date constants are entered in one of the following forms:
mm/dd/yy mm/dd/yyyy mm/dd
If the years field is less than 100, DAN converts the value as if it
were 19yy. DAN converts the first two forms to a Julian date while
the third form (mm/dd) is converted to a day of the year number (i.e.
1/1 == 1 and 12/31 == 365). Mathematical operations may be performed
on the values. For example:
START = #1/1/86 + 23;
+
Time constants are entered in one of the following forms:
hh:mm{A/P} hh:mm:ss.sss{A/P} (A & P optional)
The leading digits are considered to be an hours value if only one colon
is entered. Time should be entered in 24 hour format (e.g. 2 PM ==
14:00) unless an 'A' or 'P' is appended to indicate AM or PM time (e.g.
2 PM == 2:00P). The values are converted to a floating point number of
seconds and may be used in DANAL expressions. For example:
BIAS = #9:30:15.235;
+
Statements containing only constants execute only once (except PLOT
statements); no implicit looping takes place unless the statement is
deliberately grouped via the ampersand terminator with other statements
containing variables. For example,
YMIN = 0;
would only execute one time, while
YMIN = 0 & YMAX = MAX(force);
would set YMIN to 0 for each step time in the current processing period
and thus slow down execution of the grouped statements.